package VN.EDU.IMIC.DEVELOPER.TRANTHITHANHNGA.OOP.chanle;

public class EvenOddModel {

	public String checkNumber(EvenOddEntity Object) {
		int i = 0; int count =0;
		String k = "";
		if (Object.getA() % 2 == 0) {
			while (i <= Object.getA()) {
				if (i % 2 == 0) {
					k = "Odd" + i;
					System.out.println(k);
					count++;
				}
				i++;
			}
		} else {
			while (i <= Object.getA()) {
				if (i % 2 != 0) {
					k = "Even" + i;
					System.out.println(k);
					count++;
				}
				i++;
			}
		}
		return "There are "+count+" odd/even numbers";
	}

}
